package 其他.报数游戏;

import java.util.Scanner;

public class Main_3 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int m = scanner.nextInt();

        Emtity first = new Emtity( 1);

        Emtity p=first;

        for (int i = 1; i < 100; i++) {
            Emtity emtity = new Emtity(i + 1);
            p.next=emtity;
            p=p.next;
        }

        p.next=first;
        int time =0;
        int count=0;
        int rest=100;
        while (rest>=m){
            time++;
            count++;
            if (count==m){
                p.next=p.next.next;
                count=0;
                rest--;
            }else {
                p=p.next;
            }
        }
        System.out.println(time);
        for (int i = 0; i < m - 1; i++) {
            System.out.println(p.value);
            p=p.next;
        }
    }
}

class Emtity{
    public int value;
    public Emtity next;
    public Emtity(int value){
        this.value=value;
    }
}
